<template>
	<view class="square-container">
		<!-- 头部 -->
		<view class="header">
			<view class="header-title">
				绘本广场
			</view>
			<view class="header-search">
				<uv-icon name="search"></uv-icon>
			</view>
		</view>

		<!-- Banner与分类 -->
		<view class="banner">
			<image src="../../static/FRAME.png" mode="widthFix"></image>
			<view class="banner-title">精选绘本</view>
			<view class="banner-subtitle">发现更多精彩故事</view>
		</view>
		<view class="category-list">
			<view v-for="item in 4" :key="item.id" class="category-item">
				<view class="round-button">
					<uv-icon name="search"></uv-icon>
				</view>
				<view class="button-text">
					成长故事
				</view>
			</view>
		</view>

		<!-- 热门绘本 -->
		<view class="hot-books">
			<view class="hot-books-title">
				<view class="hot-books-title-text">
					热门绘本
				</view>
				<view class="hot-books-title-more">
					查看更多
				</view>
			</view>
			<view class="hot-books-list">
				<view v-for="item in 4" :key="item.id" class="hot-books-item">
					<view class="hot-books-item-image">
						<image src="../../static/FRAME.png" mode="widthFix"></image>
					</view>
					<view class="hot-books-item-title">
						小熊宝宝绘本
					</view>
					<view class="hot-books-item-subtitle">
						<view class="hot-books-item-subtitle-author">
							[日]佐佐木洋子
						</view>
						<view>
							<uv-icon name="star-fill"></uv-icon>
						</view>
					</view>
				</view>
			</view>
		</view>

		<!-- Tabbar -->
		<Tabbar :active="1"></Tabbar>
	</view>
</template>

<script>
export default {
	data() {
		return {

		}
	},
	methods: {

	}
}
</script>

<style lang="scss" scoped>
.square-container {
	padding: 20rpx;

	.header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx;
		box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, .1);

		.header-title {
			font-size: 36rpx;
			font-weight: bold;
		}

		.header-search {
			font-size: 40rpx;
		}
	}

	.banner {
		margin: 20rpx 0;
		width: 100%;
		height: 300rpx;
		border-radius: 25rpx;
		overflow: hidden;
		position: relative;

		image {
			width: 100%;
			object-fit: cover;
		}

		.banner-title {
			position: absolute;
			bottom: 70rpx;
			left: 40rpx;
			font-size: 40rpx;
			font-weight: bold;
			color: #fff;
		}

		.banner-subtitle {
			position: absolute;
			bottom: 30rpx;
			left: 40rpx;
			font-size: 24rpx;
			color: #fff;
		}
	}

	.category-list {
		display: flex;
		justify-content: space-around;
		align-items: center;
		padding: 20rpx 0;

		.category-item {
			display: flex;
			flex-direction: column;
			align-items: center;

			.round-button {
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
				background-color: #f5f5f5;
				display: flex;
				justify-content: center;
			}

			.button-text {
				margin-top: 10rpx;
				font-size: 24rpx;
				color: #333;
			}
		}
	}

	.hot-books {
		margin-top: 20rpx;

		.hot-books-title {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 20rpx 0;

			.hot-books-title-text {
				font-size: 32rpx;
				font-weight: bold;
			}

			.hot-books-title-more {
				font-size: 24rpx;
				color: #999;
			}
		}

		.hot-books-list {
			display: flex;
			justify-content: space-between;
			align-items: center;
			flex-wrap: wrap;

			.hot-books-item {
				width: calc(50% - 55rpx);
				margin-bottom: 20rpx;
				background-color: #fff;
				border-radius: 10rpx;
				padding: 20rpx;
				box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, .1);

				.hot-books-item-image {
					width: 100%;
					height: 200rpx;
					border-radius: 10rpx;
					overflow: hidden;

					image {
						width: 100%;
						object-fit: cover;
					}
				}

				.hot-books-item-title {
					font-size: 28rpx;
					font-weight: bold;
					margin: 10rpx 0;
				}

				.hot-books-item-subtitle {
					display: flex;
					justify-content: space-between;
					align-items: center;

					.hot-books-item-subtitle-author {
						font-size: 24rpx;
						color: #999;
					}
				}
			}
		}
	}
}
</style>
